package com.mouse.hxsj.entity.enums;

import com.mouse.hxsj.entity.common.Point;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 角色相对坐标
 */
@Getter
@AllArgsConstructor
public enum RoleEnum {
    role_null(0, "未选择", null),
    role_1(1, "1", new Point(164,140)),
    role_2(2, "2", new Point(496,127)),
    role_3(3, "3", new Point(871,129)),
    ;
    private Integer roleNum;
    private String roleName;
    private Point point;

    public static RoleEnum getByNum(Integer roleNum) {
        if (roleNum == null) return null;
        for (RoleEnum roleEnum : values()) {
            if (roleEnum.getRoleNum() != null && roleEnum.getRoleNum().equals(roleNum)) {
                return roleEnum;
            }
        }
        return null;
    }

    @Override
    public String toString() {
        return roleName;
    }}
